\(\int (3+b \sin (e+f x))^3 (c+d \sin (e+f x))^2 \, dx\) [687]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [B] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 25, antiderivative size = 289 \[ \int (3+b \sin (e+f x))^3 (c+d \sin (e+f x))^2 \, dx=\frac {1}{8} \left (216 b c d+6 b^3 c d+108 \left (2 c^2+d^2\right )+9 b^2 \left (4 c^2+3 d^2\right )\right ) x-\frac {\left (810 b c d+360 b^3 c d-243 d^2+4 b^4 \left (5 c^2+4 d^2\right )+36 b^2 \left (20 c^2+13 d^2\right )\right ) \cos (e+f x)}{30 b f}-\frac {\left (540 b c d+90 b^3 c d-162 d^2+3 b^2 \left (100 c^2+71 d^2\right )\right ) \cos (e+f x) \sin (e+f x)}{120 f}-\frac {\left (9 (10 b c-3 d) d+4 b^2 \left (5 c^2+4 d^2\right )\right ) \cos (e+f x) (3+b \sin (e+f x))^2}{60 b f}-\frac {(10 b c-3 d) d \cos (e+f x) (3+b \sin (e+f x))^3}{20 b f}-\frac {d^2 \cos (e+f x) (3+b \sin (e+f x))^4}{5 b f} \]

[Out]

1/8*(24*a^2*b*c*d+6*b^3*c*d+4*a^3*(2*c^2+d^2)+3*a*b^2*(4*c^2+3*d^2))*x-1/30*(30*a^3*b*c*d+120*a*b^3*c*d-3*a^4*
d^2+4*b^4*(5*c^2+4*d^2)+4*a^2*b^2*(20*c^2+13*d^2))*cos(f*x+e)/b/f-1/120*(60*a^2*b*c*d+90*b^3*c*d-6*a^3*d^2+a*b
^2*(100*c^2+71*d^2))*cos(f*x+e)*sin(f*x+e)/f-1/60*(3*a*d*(-a*d+10*b*c)+4*b^2*(5*c^2+4*d^2))*cos(f*x+e)*(a+b*si
n(f*x+e))^2/b/f-1/20*d*(-a*d+10*b*c)*cos(f*x+e)*(a+b*sin(f*x+e))^3/b/f-1/5*d^2*cos(f*x+e)*(a+b*sin(f*x+e))^4/b
/f

Rubi [A] (verified)

Time = 0.31 (sec) , antiderivative size = 315, normalized size of antiderivative = 1.09, number of steps used = 4, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.120, Rules used = {2870, 2832, 2813} \[ \int (3+b \sin (e+f x))^3 (c+d \sin (e+f x))^2 \, dx=-\frac {\left (-6 a^3 d^2+60 a^2 b c d+a b^2 \left (100 c^2+71 d^2\right )+90 b^3 c d\right ) \sin (e+f x) \cos (e+f x)}{120 f}+\frac {1}{8} x \left (4 a^3 \left (2 c^2+d^2\right )+24 a^2 b c d+3 a b^2 \left (4 c^2+3 d^2\right )+6 b^3 c d\right )-\frac {\left (-3 a^4 d^2+30 a^3 b c d+4 a^2 b^2 \left (20 c^2+13 d^2\right )+120 a b^3 c d+4 b^4 \left (5 c^2+4 d^2\right )\right ) \cos (e+f x)}{30 b f}-\frac {\left (3 a d (10 b c-a d)+4 b^2 \left (5 c^2+4 d^2\right )\right ) \cos (e+f x) (a+b \sin (e+f x))^2}{60 b f}-\frac {d (10 b c-a d) \cos (e+f x) (a+b \sin (e+f x))^3}{20 b f}-\frac {d^2 \cos (e+f x) (a+b \sin (e+f x))^4}{5 b f} \]

[In]

Int[(a + b*Sin[e + f*x])^3*(c + d*Sin[e + f*x])^2,x]

[Out]

((24*a^2*b*c*d + 6*b^3*c*d + 4*a^3*(2*c^2 + d^2) + 3*a*b^2*(4*c^2 + 3*d^2))*x)/8 - ((30*a^3*b*c*d + 120*a*b^3*
c*d - 3*a^4*d^2 + 4*b^4*(5*c^2 + 4*d^2) + 4*a^2*b^2*(20*c^2 + 13*d^2))*Cos[e + f*x])/(30*b*f) - ((60*a^2*b*c*d
 + 90*b^3*c*d - 6*a^3*d^2 + a*b^2*(100*c^2 + 71*d^2))*Cos[e + f*x]*Sin[e + f*x])/(120*f) - ((3*a*d*(10*b*c - a
*d) + 4*b^2*(5*c^2 + 4*d^2))*Cos[e + f*x]*(a + b*Sin[e + f*x])^2)/(60*b*f) - (d*(10*b*c - a*d)*Cos[e + f*x]*(a
 + b*Sin[e + f*x])^3)/(20*b*f) - (d^2*Cos[e + f*x]*(a + b*Sin[e + f*x])^4)/(5*b*f)

Rule 2813

Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(2*a*c +
 b*d)*(x/2), x] + (-Simp[(b*c + a*d)*(Cos[e + f*x]/f), x] - Simp[b*d*Cos[e + f*x]*(Sin[e + f*x]/(2*f)), x]) /;
 FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0]

Rule 2832

Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(-d
)*Cos[e + f*x]*((a + b*Sin[e + f*x])^m/(f*(m + 1))), x] + Dist[1/(m + 1), Int[(a + b*Sin[e + f*x])^(m - 1)*Sim
p[b*d*m + a*c*(m + 1) + (a*d*m + b*c*(m + 1))*Sin[e + f*x], x], x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[
b*c - a*d, 0] && NeQ[a^2 - b^2, 0] && GtQ[m, 0] && IntegerQ[2*m]

Rule 2870

Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)])^2, x_Symbol] :> Simp[(
-d^2)*Cos[e + f*x]*((a + b*Sin[e + f*x])^(m + 1)/(b*f*(m + 2))), x] + Dist[1/(b*(m + 2)), Int[(a + b*Sin[e + f
*x])^m*Simp[b*(d^2*(m + 1) + c^2*(m + 2)) - d*(a*d - 2*b*c*(m + 2))*Sin[e + f*x], x], x], x] /; FreeQ[{a, b, c
, d, e, f, m}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 - b^2, 0] &&  !LtQ[m, -1]

Rubi steps \begin{align*} \text {integral}& = -\frac {d^2 \cos (e+f x) (a+b \sin (e+f x))^4}{5 b f}+\frac {\int (a+b \sin (e+f x))^3 \left (b \left (5 c^2+4 d^2\right )+d (10 b c-a d) \sin (e+f x)\right ) \, dx}{5 b} \\ & = -\frac {d (10 b c-a d) \cos (e+f x) (a+b \sin (e+f x))^3}{20 b f}-\frac {d^2 \cos (e+f x) (a+b \sin (e+f x))^4}{5 b f}+\frac {\int (a+b \sin (e+f x))^2 \left (b \left (20 a c^2+30 b c d+13 a d^2\right )+\left (3 a d (10 b c-a d)+4 b^2 \left (5 c^2+4 d^2\right )\right ) \sin (e+f x)\right ) \, dx}{20 b} \\ & = -\frac {\left (3 a d (10 b c-a d)+4 b^2 \left (5 c^2+4 d^2\right )\right ) \cos (e+f x) (a+b \sin (e+f x))^2}{60 b f}-\frac {d (10 b c-a d) \cos (e+f x) (a+b \sin (e+f x))^3}{20 b f}-\frac {d^2 \cos (e+f x) (a+b \sin (e+f x))^4}{5 b f}+\frac {\int (a+b \sin (e+f x)) \left (b \left (150 a b c d+8 b^2 \left (5 c^2+4 d^2\right )+a^2 \left (60 c^2+33 d^2\right )\right )+\left (60 a^2 b c d+90 b^3 c d-6 a^3 d^2+a b^2 \left (100 c^2+71 d^2\right )\right ) \sin (e+f x)\right ) \, dx}{60 b} \\ & = \frac {1}{8} \left (24 a^2 b c d+6 b^3 c d+4 a^3 \left (2 c^2+d^2\right )+3 a b^2 \left (4 c^2+3 d^2\right )\right ) x-\frac {\left (30 a^3 b c d+120 a b^3 c d-3 a^4 d^2+4 b^4 \left (5 c^2+4 d^2\right )+4 a^2 b^2 \left (20 c^2+13 d^2\right )\right ) \cos (e+f x)}{30 b f}-\frac {\left (60 a^2 b c d+90 b^3 c d-6 a^3 d^2+a b^2 \left (100 c^2+71 d^2\right )\right ) \cos (e+f x) \sin (e+f x)}{120 f}-\frac {\left (3 a d (10 b c-a d)+4 b^2 \left (5 c^2+4 d^2\right )\right ) \cos (e+f x) (a+b \sin (e+f x))^2}{60 b f}-\frac {d (10 b c-a d) \cos (e+f x) (a+b \sin (e+f x))^3}{20 b f}-\frac {d^2 \cos (e+f x) (a+b \sin (e+f x))^4}{5 b f} \\ \end{align*}

Mathematica [A] (verified)

Time = 2.64 (sec) , antiderivative size = 212, normalized size of antiderivative = 0.73 \[ \int (3+b \sin (e+f x))^3 (c+d \sin (e+f x))^2 \, dx=\frac {-60 \left (432 c d+108 b^2 c d+54 b \left (4 c^2+3 d^2\right )+b^3 \left (6 c^2+5 d^2\right )\right ) \cos (e+f x)+10 b \left (72 b c d+108 d^2+b^2 \left (4 c^2+5 d^2\right )\right ) \cos (3 (e+f x))-6 b^3 d^2 \cos (5 (e+f x))+15 \left (12 \left (12 \left (6+b^2\right ) c^2+2 b \left (36+b^2\right ) c d+9 \left (4+b^2\right ) d^2\right ) (e+f x)-8 \left (54 b c d+2 b^3 c d+27 d^2+9 b^2 \left (c^2+d^2\right )\right ) \sin (2 (e+f x))+b^2 d (2 b c+9 d) \sin (4 (e+f x))\right )}{480 f} \]

[In]

Integrate[(3 + b*Sin[e + f*x])^3*(c + d*Sin[e + f*x])^2,x]

[Out]

(-60*(432*c*d + 108*b^2*c*d + 54*b*(4*c^2 + 3*d^2) + b^3*(6*c^2 + 5*d^2))*Cos[e + f*x] + 10*b*(72*b*c*d + 108*
d^2 + b^2*(4*c^2 + 5*d^2))*Cos[3*(e + f*x)] - 6*b^3*d^2*Cos[5*(e + f*x)] + 15*(12*(12*(6 + b^2)*c^2 + 2*b*(36
+ b^2)*c*d + 9*(4 + b^2)*d^2)*(e + f*x) - 8*(54*b*c*d + 2*b^3*c*d + 27*d^2 + 9*b^2*(c^2 + d^2))*Sin[2*(e + f*x
)] + b^2*d*(2*b*c + 9*d)*Sin[4*(e + f*x)]))/(480*f)

Maple [A] (verified)

Time = 3.39 (sec) , antiderivative size = 226, normalized size of antiderivative = 0.78

method result size
parts \(a^{3} c^{2} x +\frac {\left (3 a \,b^{2} d^{2}+2 b^{3} c d \right ) \left (-\frac {\left (\sin ^{3}\left (f x +e \right )+\frac {3 \sin \left (f x +e \right )}{2}\right ) \cos \left (f x +e \right )}{4}+\frac {3 f x}{8}+\frac {3 e}{8}\right )}{f}-\frac {\left (2 a^{3} c d +3 a^{2} b \,c^{2}\right ) \cos \left (f x +e \right )}{f}-\frac {\left (3 a^{2} b \,d^{2}+6 a \,b^{2} c d +b^{3} c^{2}\right ) \left (2+\sin ^{2}\left (f x +e \right )\right ) \cos \left (f x +e \right )}{3 f}+\frac {\left (a^{3} d^{2}+6 a^{2} b c d +3 a \,b^{2} c^{2}\right ) \left (-\frac {\sin \left (f x +e \right ) \cos \left (f x +e \right )}{2}+\frac {f x}{2}+\frac {e}{2}\right )}{f}-\frac {b^{3} d^{2} \left (\frac {8}{3}+\sin ^{4}\left (f x +e \right )+\frac {4 \left (\sin ^{2}\left (f x +e \right )\right )}{3}\right ) \cos \left (f x +e \right )}{5 f}\) \(226\)
parallelrisch \(\frac {\left (-240 b^{3} c d -360 a \left (c^{2}+d^{2}\right ) b^{2}-720 a^{2} b c d -120 a^{3} d^{2}\right ) \sin \left (2 f x +2 e \right )+\left (\left (40 c^{2}+50 d^{2}\right ) b^{3}+240 a \,b^{2} c d +120 a^{2} b \,d^{2}\right ) \cos \left (3 f x +3 e \right )+\left (45 a \,b^{2} d^{2}+30 b^{3} c d \right ) \sin \left (4 f x +4 e \right )-6 b^{3} d^{2} \cos \left (5 f x +5 e \right )+\left (\left (-360 c^{2}-300 d^{2}\right ) b^{3}-2160 a \,b^{2} c d -1440 \left (c^{2}+\frac {3 d^{2}}{4}\right ) a^{2} b -960 a^{3} c d \right ) \cos \left (f x +e \right )+\left (360 c d f x -320 c^{2}-256 d^{2}\right ) b^{3}+720 \left (c^{2} f x +\frac {3}{4} d^{2} f x -\frac {8}{3} c d \right ) a \,b^{2}-1440 \left (-c d f x +c^{2}+\frac {2}{3} d^{2}\right ) a^{2} b +480 \left (c^{2} f x +\frac {1}{2} d^{2} f x -2 c d \right ) a^{3}}{480 f}\) \(283\)
derivativedivides \(\frac {-\frac {b^{3} d^{2} \left (\frac {8}{3}+\sin ^{4}\left (f x +e \right )+\frac {4 \left (\sin ^{2}\left (f x +e \right )\right )}{3}\right ) \cos \left (f x +e \right )}{5}+3 a \,b^{2} d^{2} \left (-\frac {\left (\sin ^{3}\left (f x +e \right )+\frac {3 \sin \left (f x +e \right )}{2}\right ) \cos \left (f x +e \right )}{4}+\frac {3 f x}{8}+\frac {3 e}{8}\right )+2 b^{3} c d \left (-\frac {\left (\sin ^{3}\left (f x +e \right )+\frac {3 \sin \left (f x +e \right )}{2}\right ) \cos \left (f x +e \right )}{4}+\frac {3 f x}{8}+\frac {3 e}{8}\right )-a^{2} b \,d^{2} \left (2+\sin ^{2}\left (f x +e \right )\right ) \cos \left (f x +e \right )-2 a \,b^{2} c d \left (2+\sin ^{2}\left (f x +e \right )\right ) \cos \left (f x +e \right )-\frac {b^{3} c^{2} \left (2+\sin ^{2}\left (f x +e \right )\right ) \cos \left (f x +e \right )}{3}+a^{3} d^{2} \left (-\frac {\sin \left (f x +e \right ) \cos \left (f x +e \right )}{2}+\frac {f x}{2}+\frac {e}{2}\right )+6 a^{2} b c d \left (-\frac {\sin \left (f x +e \right ) \cos \left (f x +e \right )}{2}+\frac {f x}{2}+\frac {e}{2}\right )+3 a \,b^{2} c^{2} \left (-\frac {\sin \left (f x +e \right ) \cos \left (f x +e \right )}{2}+\frac {f x}{2}+\frac {e}{2}\right )-2 a^{3} c d \cos \left (f x +e \right )-3 a^{2} b \,c^{2} \cos \left (f x +e \right )+a^{3} c^{2} \left (f x +e \right )}{f}\) \(325\)
default \(\frac {-\frac {b^{3} d^{2} \left (\frac {8}{3}+\sin ^{4}\left (f x +e \right )+\frac {4 \left (\sin ^{2}\left (f x +e \right )\right )}{3}\right ) \cos \left (f x +e \right )}{5}+3 a \,b^{2} d^{2} \left (-\frac {\left (\sin ^{3}\left (f x +e \right )+\frac {3 \sin \left (f x +e \right )}{2}\right ) \cos \left (f x +e \right )}{4}+\frac {3 f x}{8}+\frac {3 e}{8}\right )+2 b^{3} c d \left (-\frac {\left (\sin ^{3}\left (f x +e \right )+\frac {3 \sin \left (f x +e \right )}{2}\right ) \cos \left (f x +e \right )}{4}+\frac {3 f x}{8}+\frac {3 e}{8}\right )-a^{2} b \,d^{2} \left (2+\sin ^{2}\left (f x +e \right )\right ) \cos \left (f x +e \right )-2 a \,b^{2} c d \left (2+\sin ^{2}\left (f x +e \right )\right ) \cos \left (f x +e \right )-\frac {b^{3} c^{2} \left (2+\sin ^{2}\left (f x +e \right )\right ) \cos \left (f x +e \right )}{3}+a^{3} d^{2} \left (-\frac {\sin \left (f x +e \right ) \cos \left (f x +e \right )}{2}+\frac {f x}{2}+\frac {e}{2}\right )+6 a^{2} b c d \left (-\frac {\sin \left (f x +e \right ) \cos \left (f x +e \right )}{2}+\frac {f x}{2}+\frac {e}{2}\right )+3 a \,b^{2} c^{2} \left (-\frac {\sin \left (f x +e \right ) \cos \left (f x +e \right )}{2}+\frac {f x}{2}+\frac {e}{2}\right )-2 a^{3} c d \cos \left (f x +e \right )-3 a^{2} b \,c^{2} \cos \left (f x +e \right )+a^{3} c^{2} \left (f x +e \right )}{f}\) \(325\)
risch \(a^{3} c^{2} x +\frac {x \,a^{3} d^{2}}{2}+3 x \,a^{2} b c d +\frac {3 x a \,b^{2} c^{2}}{2}+\frac {9 x a \,b^{2} d^{2}}{8}+\frac {3 x \,b^{3} c d}{4}-\frac {2 \cos \left (f x +e \right ) a^{3} c d}{f}-\frac {3 \cos \left (f x +e \right ) a^{2} b \,c^{2}}{f}-\frac {9 \cos \left (f x +e \right ) a^{2} b \,d^{2}}{4 f}-\frac {9 \cos \left (f x +e \right ) a \,b^{2} c d}{2 f}-\frac {3 \cos \left (f x +e \right ) b^{3} c^{2}}{4 f}-\frac {5 \cos \left (f x +e \right ) b^{3} d^{2}}{8 f}-\frac {b^{3} d^{2} \cos \left (5 f x +5 e \right )}{80 f}+\frac {3 \sin \left (4 f x +4 e \right ) a \,b^{2} d^{2}}{32 f}+\frac {\sin \left (4 f x +4 e \right ) b^{3} c d}{16 f}+\frac {b \cos \left (3 f x +3 e \right ) d^{2} a^{2}}{4 f}+\frac {b^{2} \cos \left (3 f x +3 e \right ) a c d}{2 f}+\frac {b^{3} \cos \left (3 f x +3 e \right ) c^{2}}{12 f}+\frac {5 b^{3} \cos \left (3 f x +3 e \right ) d^{2}}{48 f}-\frac {\sin \left (2 f x +2 e \right ) a^{3} d^{2}}{4 f}-\frac {3 \sin \left (2 f x +2 e \right ) a^{2} b c d}{2 f}-\frac {3 \sin \left (2 f x +2 e \right ) a \,b^{2} c^{2}}{4 f}-\frac {3 \sin \left (2 f x +2 e \right ) a \,b^{2} d^{2}}{4 f}-\frac {\sin \left (2 f x +2 e \right ) b^{3} c d}{2 f}\) \(401\)
norman \(\frac {\left (a^{3} c^{2}+\frac {1}{2} a^{3} d^{2}+3 a^{2} b c d +\frac {3}{2} a \,b^{2} c^{2}+\frac {9}{8} a \,b^{2} d^{2}+\frac {3}{4} b^{3} c d \right ) x +\left (a^{3} c^{2}+\frac {1}{2} a^{3} d^{2}+3 a^{2} b c d +\frac {3}{2} a \,b^{2} c^{2}+\frac {9}{8} a \,b^{2} d^{2}+\frac {3}{4} b^{3} c d \right ) x \left (\tan ^{10}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )+\left (5 a^{3} c^{2}+\frac {5}{2} a^{3} d^{2}+15 a^{2} b c d +\frac {15}{2} a \,b^{2} c^{2}+\frac {45}{8} a \,b^{2} d^{2}+\frac {15}{4} b^{3} c d \right ) x \left (\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )+\left (5 a^{3} c^{2}+\frac {5}{2} a^{3} d^{2}+15 a^{2} b c d +\frac {15}{2} a \,b^{2} c^{2}+\frac {45}{8} a \,b^{2} d^{2}+\frac {15}{4} b^{3} c d \right ) x \left (\tan ^{8}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )+\left (10 a^{3} c^{2}+5 a^{3} d^{2}+30 a^{2} b c d +15 a \,b^{2} c^{2}+\frac {45}{4} a \,b^{2} d^{2}+\frac {15}{2} b^{3} c d \right ) x \left (\tan ^{4}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )+\left (10 a^{3} c^{2}+5 a^{3} d^{2}+30 a^{2} b c d +15 a \,b^{2} c^{2}+\frac {45}{4} a \,b^{2} d^{2}+\frac {15}{2} b^{3} c d \right ) x \left (\tan ^{6}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )-\frac {60 a^{3} c d +90 a^{2} b \,c^{2}+60 a^{2} b \,d^{2}+120 a \,b^{2} c d +20 b^{3} c^{2}+16 b^{3} d^{2}}{15 f}-\frac {\left (4 a^{3} c d +6 a^{2} b \,c^{2}\right ) \left (\tan ^{8}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{f}-\frac {\left (4 a^{3} d^{2}+24 a^{2} b c d +12 a \,b^{2} c^{2}+9 a \,b^{2} d^{2}+6 b^{3} c d \right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{4 f}+\frac {\left (4 a^{3} d^{2}+24 a^{2} b c d +12 a \,b^{2} c^{2}+9 a \,b^{2} d^{2}+6 b^{3} c d \right ) \left (\tan ^{9}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{4 f}-\frac {\left (4 a^{3} d^{2}+24 a^{2} b c d +12 a \,b^{2} c^{2}+21 a \,b^{2} d^{2}+14 b^{3} c d \right ) \left (\tan ^{3}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{2 f}+\frac {\left (4 a^{3} d^{2}+24 a^{2} b c d +12 a \,b^{2} c^{2}+21 a \,b^{2} d^{2}+14 b^{3} c d \right ) \left (\tan ^{7}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{2 f}-\frac {2 \left (8 a^{3} c d +12 a^{2} b \,c^{2}+6 a^{2} b \,d^{2}+12 a \,b^{2} c d +2 b^{3} c^{2}\right ) \left (\tan ^{6}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{f}-\frac {2 \left (36 a^{3} c d +54 a^{2} b \,c^{2}+42 a^{2} b \,d^{2}+84 a \,b^{2} c d +14 b^{3} c^{2}+16 b^{3} d^{2}\right ) \left (\tan ^{4}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{3 f}-\frac {\left (48 a^{3} c d +72 a^{2} b \,c^{2}+60 a^{2} b \,d^{2}+120 a \,b^{2} c d +20 b^{3} c^{2}+16 b^{3} d^{2}\right ) \left (\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{3 f}}{\left (1+\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )^{5}}\) \(891\)

[In]

int((a+b*sin(f*x+e))^3*(c+d*sin(f*x+e))^2,x,method=_RETURNVERBOSE)

[Out]

a^3*c^2*x+(3*a*b^2*d^2+2*b^3*c*d)/f*(-1/4*(sin(f*x+e)^3+3/2*sin(f*x+e))*cos(f*x+e)+3/8*f*x+3/8*e)-(2*a^3*c*d+3
*a^2*b*c^2)/f*cos(f*x+e)-1/3*(3*a^2*b*d^2+6*a*b^2*c*d+b^3*c^2)/f*(2+sin(f*x+e)^2)*cos(f*x+e)+(a^3*d^2+6*a^2*b*
c*d+3*a*b^2*c^2)/f*(-1/2*sin(f*x+e)*cos(f*x+e)+1/2*f*x+1/2*e)-1/5*b^3*d^2/f*(8/3+sin(f*x+e)^4+4/3*sin(f*x+e)^2
)*cos(f*x+e)

Fricas [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 253, normalized size of antiderivative = 0.88 \[ \int (3+b \sin (e+f x))^3 (c+d \sin (e+f x))^2 \, dx=-\frac {24 \, b^{3} d^{2} \cos \left (f x + e\right )^{5} - 40 \, {\left (b^{3} c^{2} + 6 \, a b^{2} c d + {\left (3 \, a^{2} b + 2 \, b^{3}\right )} d^{2}\right )} \cos \left (f x + e\right )^{3} - 15 \, {\left (4 \, {\left (2 \, a^{3} + 3 \, a b^{2}\right )} c^{2} + 6 \, {\left (4 \, a^{2} b + b^{3}\right )} c d + {\left (4 \, a^{3} + 9 \, a b^{2}\right )} d^{2}\right )} f x + 120 \, {\left ({\left (3 \, a^{2} b + b^{3}\right )} c^{2} + 2 \, {\left (a^{3} + 3 \, a b^{2}\right )} c d + {\left (3 \, a^{2} b + b^{3}\right )} d^{2}\right )} \cos \left (f x + e\right ) - 15 \, {\left (2 \, {\left (2 \, b^{3} c d + 3 \, a b^{2} d^{2}\right )} \cos \left (f x + e\right )^{3} - {\left (12 \, a b^{2} c^{2} + 2 \, {\left (12 \, a^{2} b + 5 \, b^{3}\right )} c d + {\left (4 \, a^{3} + 15 \, a b^{2}\right )} d^{2}\right )} \cos \left (f x + e\right )\right )} \sin \left (f x + e\right )}{120 \, f} \]

[In]

integrate((a+b*sin(f*x+e))^3*(c+d*sin(f*x+e))^2,x, algorithm="fricas")

[Out]

-1/120*(24*b^3*d^2*cos(f*x + e)^5 - 40*(b^3*c^2 + 6*a*b^2*c*d + (3*a^2*b + 2*b^3)*d^2)*cos(f*x + e)^3 - 15*(4*
(2*a^3 + 3*a*b^2)*c^2 + 6*(4*a^2*b + b^3)*c*d + (4*a^3 + 9*a*b^2)*d^2)*f*x + 120*((3*a^2*b + b^3)*c^2 + 2*(a^3
 + 3*a*b^2)*c*d + (3*a^2*b + b^3)*d^2)*cos(f*x + e) - 15*(2*(2*b^3*c*d + 3*a*b^2*d^2)*cos(f*x + e)^3 - (12*a*b
^2*c^2 + 2*(12*a^2*b + 5*b^3)*c*d + (4*a^3 + 15*a*b^2)*d^2)*cos(f*x + e))*sin(f*x + e))/f

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 729 vs. \(2 (301) = 602\).

Time = 0.33 (sec) , antiderivative size = 729, normalized size of antiderivative = 2.52 \[ \int (3+b \sin (e+f x))^3 (c+d \sin (e+f x))^2 \, dx=\begin {cases} a^{3} c^{2} x - \frac {2 a^{3} c d \cos {\left (e + f x \right )}}{f} + \frac {a^{3} d^{2} x \sin ^{2}{\left (e + f x \right )}}{2} + \frac {a^{3} d^{2} x \cos ^{2}{\left (e + f x \right )}}{2} - \frac {a^{3} d^{2} \sin {\left (e + f x \right )} \cos {\left (e + f x \right )}}{2 f} - \frac {3 a^{2} b c^{2} \cos {\left (e + f x \right )}}{f} + 3 a^{2} b c d x \sin ^{2}{\left (e + f x \right )} + 3 a^{2} b c d x \cos ^{2}{\left (e + f x \right )} - \frac {3 a^{2} b c d \sin {\left (e + f x \right )} \cos {\left (e + f x \right )}}{f} - \frac {3 a^{2} b d^{2} \sin ^{2}{\left (e + f x \right )} \cos {\left (e + f x \right )}}{f} - \frac {2 a^{2} b d^{2} \cos ^{3}{\left (e + f x \right )}}{f} + \frac {3 a b^{2} c^{2} x \sin ^{2}{\left (e + f x \right )}}{2} + \frac {3 a b^{2} c^{2} x \cos ^{2}{\left (e + f x \right )}}{2} - \frac {3 a b^{2} c^{2} \sin {\left (e + f x \right )} \cos {\left (e + f x \right )}}{2 f} - \frac {6 a b^{2} c d \sin ^{2}{\left (e + f x \right )} \cos {\left (e + f x \right )}}{f} - \frac {4 a b^{2} c d \cos ^{3}{\left (e + f x \right )}}{f} + \frac {9 a b^{2} d^{2} x \sin ^{4}{\left (e + f x \right )}}{8} + \frac {9 a b^{2} d^{2} x \sin ^{2}{\left (e + f x \right )} \cos ^{2}{\left (e + f x \right )}}{4} + \frac {9 a b^{2} d^{2} x \cos ^{4}{\left (e + f x \right )}}{8} - \frac {15 a b^{2} d^{2} \sin ^{3}{\left (e + f x \right )} \cos {\left (e + f x \right )}}{8 f} - \frac {9 a b^{2} d^{2} \sin {\left (e + f x \right )} \cos ^{3}{\left (e + f x \right )}}{8 f} - \frac {b^{3} c^{2} \sin ^{2}{\left (e + f x \right )} \cos {\left (e + f x \right )}}{f} - \frac {2 b^{3} c^{2} \cos ^{3}{\left (e + f x \right )}}{3 f} + \frac {3 b^{3} c d x \sin ^{4}{\left (e + f x \right )}}{4} + \frac {3 b^{3} c d x \sin ^{2}{\left (e + f x \right )} \cos ^{2}{\left (e + f x \right )}}{2} + \frac {3 b^{3} c d x \cos ^{4}{\left (e + f x \right )}}{4} - \frac {5 b^{3} c d \sin ^{3}{\left (e + f x \right )} \cos {\left (e + f x \right )}}{4 f} - \frac {3 b^{3} c d \sin {\left (e + f x \right )} \cos ^{3}{\left (e + f x \right )}}{4 f} - \frac {b^{3} d^{2} \sin ^{4}{\left (e + f x \right )} \cos {\left (e + f x \right )}}{f} - \frac {4 b^{3} d^{2} \sin ^{2}{\left (e + f x \right )} \cos ^{3}{\left (e + f x \right )}}{3 f} - \frac {8 b^{3} d^{2} \cos ^{5}{\left (e + f x \right )}}{15 f} & \text {for}\: f \neq 0 \\x \left (a + b \sin {\left (e \right )}\right )^{3} \left (c + d \sin {\left (e \right )}\right )^{2} & \text {otherwise} \end {cases} \]

[In]

integrate((a+b*sin(f*x+e))**3*(c+d*sin(f*x+e))**2,x)

[Out]

Piecewise((a**3*c**2*x - 2*a**3*c*d*cos(e + f*x)/f + a**3*d**2*x*sin(e + f*x)**2/2 + a**3*d**2*x*cos(e + f*x)*
*2/2 - a**3*d**2*sin(e + f*x)*cos(e + f*x)/(2*f) - 3*a**2*b*c**2*cos(e + f*x)/f + 3*a**2*b*c*d*x*sin(e + f*x)*
*2 + 3*a**2*b*c*d*x*cos(e + f*x)**2 - 3*a**2*b*c*d*sin(e + f*x)*cos(e + f*x)/f - 3*a**2*b*d**2*sin(e + f*x)**2
*cos(e + f*x)/f - 2*a**2*b*d**2*cos(e + f*x)**3/f + 3*a*b**2*c**2*x*sin(e + f*x)**2/2 + 3*a*b**2*c**2*x*cos(e
+ f*x)**2/2 - 3*a*b**2*c**2*sin(e + f*x)*cos(e + f*x)/(2*f) - 6*a*b**2*c*d*sin(e + f*x)**2*cos(e + f*x)/f - 4*
a*b**2*c*d*cos(e + f*x)**3/f + 9*a*b**2*d**2*x*sin(e + f*x)**4/8 + 9*a*b**2*d**2*x*sin(e + f*x)**2*cos(e + f*x
)**2/4 + 9*a*b**2*d**2*x*cos(e + f*x)**4/8 - 15*a*b**2*d**2*sin(e + f*x)**3*cos(e + f*x)/(8*f) - 9*a*b**2*d**2
*sin(e + f*x)*cos(e + f*x)**3/(8*f) - b**3*c**2*sin(e + f*x)**2*cos(e + f*x)/f - 2*b**3*c**2*cos(e + f*x)**3/(
3*f) + 3*b**3*c*d*x*sin(e + f*x)**4/4 + 3*b**3*c*d*x*sin(e + f*x)**2*cos(e + f*x)**2/2 + 3*b**3*c*d*x*cos(e +
f*x)**4/4 - 5*b**3*c*d*sin(e + f*x)**3*cos(e + f*x)/(4*f) - 3*b**3*c*d*sin(e + f*x)*cos(e + f*x)**3/(4*f) - b*
*3*d**2*sin(e + f*x)**4*cos(e + f*x)/f - 4*b**3*d**2*sin(e + f*x)**2*cos(e + f*x)**3/(3*f) - 8*b**3*d**2*cos(e
 + f*x)**5/(15*f), Ne(f, 0)), (x*(a + b*sin(e))**3*(c + d*sin(e))**2, True))

Maxima [A] (verification not implemented)

none

Time = 0.23 (sec) , antiderivative size = 314, normalized size of antiderivative = 1.09 \[ \int (3+b \sin (e+f x))^3 (c+d \sin (e+f x))^2 \, dx=\frac {480 \, {\left (f x + e\right )} a^{3} c^{2} + 360 \, {\left (2 \, f x + 2 \, e - \sin \left (2 \, f x + 2 \, e\right )\right )} a b^{2} c^{2} + 160 \, {\left (\cos \left (f x + e\right )^{3} - 3 \, \cos \left (f x + e\right )\right )} b^{3} c^{2} + 720 \, {\left (2 \, f x + 2 \, e - \sin \left (2 \, f x + 2 \, e\right )\right )} a^{2} b c d + 960 \, {\left (\cos \left (f x + e\right )^{3} - 3 \, \cos \left (f x + e\right )\right )} a b^{2} c d + 30 \, {\left (12 \, f x + 12 \, e + \sin \left (4 \, f x + 4 \, e\right ) - 8 \, \sin \left (2 \, f x + 2 \, e\right )\right )} b^{3} c d + 120 \, {\left (2 \, f x + 2 \, e - \sin \left (2 \, f x + 2 \, e\right )\right )} a^{3} d^{2} + 480 \, {\left (\cos \left (f x + e\right )^{3} - 3 \, \cos \left (f x + e\right )\right )} a^{2} b d^{2} + 45 \, {\left (12 \, f x + 12 \, e + \sin \left (4 \, f x + 4 \, e\right ) - 8 \, \sin \left (2 \, f x + 2 \, e\right )\right )} a b^{2} d^{2} - 32 \, {\left (3 \, \cos \left (f x + e\right )^{5} - 10 \, \cos \left (f x + e\right )^{3} + 15 \, \cos \left (f x + e\right )\right )} b^{3} d^{2} - 1440 \, a^{2} b c^{2} \cos \left (f x + e\right ) - 960 \, a^{3} c d \cos \left (f x + e\right )}{480 \, f} \]

[In]

integrate((a+b*sin(f*x+e))^3*(c+d*sin(f*x+e))^2,x, algorithm="maxima")

[Out]

1/480*(480*(f*x + e)*a^3*c^2 + 360*(2*f*x + 2*e - sin(2*f*x + 2*e))*a*b^2*c^2 + 160*(cos(f*x + e)^3 - 3*cos(f*
x + e))*b^3*c^2 + 720*(2*f*x + 2*e - sin(2*f*x + 2*e))*a^2*b*c*d + 960*(cos(f*x + e)^3 - 3*cos(f*x + e))*a*b^2
*c*d + 30*(12*f*x + 12*e + sin(4*f*x + 4*e) - 8*sin(2*f*x + 2*e))*b^3*c*d + 120*(2*f*x + 2*e - sin(2*f*x + 2*e
))*a^3*d^2 + 480*(cos(f*x + e)^3 - 3*cos(f*x + e))*a^2*b*d^2 + 45*(12*f*x + 12*e + sin(4*f*x + 4*e) - 8*sin(2*
f*x + 2*e))*a*b^2*d^2 - 32*(3*cos(f*x + e)^5 - 10*cos(f*x + e)^3 + 15*cos(f*x + e))*b^3*d^2 - 1440*a^2*b*c^2*c
os(f*x + e) - 960*a^3*c*d*cos(f*x + e))/f

Giac [A] (verification not implemented)

none

Time = 0.29 (sec) , antiderivative size = 269, normalized size of antiderivative = 0.93 \[ \int (3+b \sin (e+f x))^3 (c+d \sin (e+f x))^2 \, dx=-\frac {b^{3} d^{2} \cos \left (5 \, f x + 5 \, e\right )}{80 \, f} + \frac {1}{8} \, {\left (8 \, a^{3} c^{2} + 12 \, a b^{2} c^{2} + 24 \, a^{2} b c d + 6 \, b^{3} c d + 4 \, a^{3} d^{2} + 9 \, a b^{2} d^{2}\right )} x + \frac {{\left (4 \, b^{3} c^{2} + 24 \, a b^{2} c d + 12 \, a^{2} b d^{2} + 5 \, b^{3} d^{2}\right )} \cos \left (3 \, f x + 3 \, e\right )}{48 \, f} - \frac {{\left (24 \, a^{2} b c^{2} + 6 \, b^{3} c^{2} + 16 \, a^{3} c d + 36 \, a b^{2} c d + 18 \, a^{2} b d^{2} + 5 \, b^{3} d^{2}\right )} \cos \left (f x + e\right )}{8 \, f} + \frac {{\left (2 \, b^{3} c d + 3 \, a b^{2} d^{2}\right )} \sin \left (4 \, f x + 4 \, e\right )}{32 \, f} - \frac {{\left (3 \, a b^{2} c^{2} + 6 \, a^{2} b c d + 2 \, b^{3} c d + a^{3} d^{2} + 3 \, a b^{2} d^{2}\right )} \sin \left (2 \, f x + 2 \, e\right )}{4 \, f} \]

[In]

integrate((a+b*sin(f*x+e))^3*(c+d*sin(f*x+e))^2,x, algorithm="giac")

[Out]

-1/80*b^3*d^2*cos(5*f*x + 5*e)/f + 1/8*(8*a^3*c^2 + 12*a*b^2*c^2 + 24*a^2*b*c*d + 6*b^3*c*d + 4*a^3*d^2 + 9*a*
b^2*d^2)*x + 1/48*(4*b^3*c^2 + 24*a*b^2*c*d + 12*a^2*b*d^2 + 5*b^3*d^2)*cos(3*f*x + 3*e)/f - 1/8*(24*a^2*b*c^2
 + 6*b^3*c^2 + 16*a^3*c*d + 36*a*b^2*c*d + 18*a^2*b*d^2 + 5*b^3*d^2)*cos(f*x + e)/f + 1/32*(2*b^3*c*d + 3*a*b^
2*d^2)*sin(4*f*x + 4*e)/f - 1/4*(3*a*b^2*c^2 + 6*a^2*b*c*d + 2*b^3*c*d + a^3*d^2 + 3*a*b^2*d^2)*sin(2*f*x + 2*
e)/f

Mupad [B] (verification not implemented)

Time = 8.80 (sec) , antiderivative size = 358, normalized size of antiderivative = 1.24 \[ \int (3+b \sin (e+f x))^3 (c+d \sin (e+f x))^2 \, dx=-\frac {90\,b^3\,c^2\,\cos \left (e+f\,x\right )+75\,b^3\,d^2\,\cos \left (e+f\,x\right )-10\,b^3\,c^2\,\cos \left (3\,e+3\,f\,x\right )-\frac {25\,b^3\,d^2\,\cos \left (3\,e+3\,f\,x\right )}{2}+\frac {3\,b^3\,d^2\,\cos \left (5\,e+5\,f\,x\right )}{2}+30\,a^3\,d^2\,\sin \left (2\,e+2\,f\,x\right )-30\,a^2\,b\,d^2\,\cos \left (3\,e+3\,f\,x\right )+90\,a\,b^2\,c^2\,\sin \left (2\,e+2\,f\,x\right )+90\,a\,b^2\,d^2\,\sin \left (2\,e+2\,f\,x\right )-\frac {45\,a\,b^2\,d^2\,\sin \left (4\,e+4\,f\,x\right )}{4}+240\,a^3\,c\,d\,\cos \left (e+f\,x\right )+360\,a^2\,b\,c^2\,\cos \left (e+f\,x\right )+270\,a^2\,b\,d^2\,\cos \left (e+f\,x\right )+60\,b^3\,c\,d\,\sin \left (2\,e+2\,f\,x\right )-\frac {15\,b^3\,c\,d\,\sin \left (4\,e+4\,f\,x\right )}{2}-120\,a^3\,c^2\,f\,x-60\,a^3\,d^2\,f\,x-60\,a\,b^2\,c\,d\,\cos \left (3\,e+3\,f\,x\right )+180\,a^2\,b\,c\,d\,\sin \left (2\,e+2\,f\,x\right )-180\,a\,b^2\,c^2\,f\,x-135\,a\,b^2\,d^2\,f\,x+540\,a\,b^2\,c\,d\,\cos \left (e+f\,x\right )-90\,b^3\,c\,d\,f\,x-360\,a^2\,b\,c\,d\,f\,x}{120\,f} \]

[In]

int((a + b*sin(e + f*x))^3*(c + d*sin(e + f*x))^2,x)

[Out]

-(90*b^3*c^2*cos(e + f*x) + 75*b^3*d^2*cos(e + f*x) - 10*b^3*c^2*cos(3*e + 3*f*x) - (25*b^3*d^2*cos(3*e + 3*f*
x))/2 + (3*b^3*d^2*cos(5*e + 5*f*x))/2 + 30*a^3*d^2*sin(2*e + 2*f*x) - 30*a^2*b*d^2*cos(3*e + 3*f*x) + 90*a*b^
2*c^2*sin(2*e + 2*f*x) + 90*a*b^2*d^2*sin(2*e + 2*f*x) - (45*a*b^2*d^2*sin(4*e + 4*f*x))/4 + 240*a^3*c*d*cos(e
 + f*x) + 360*a^2*b*c^2*cos(e + f*x) + 270*a^2*b*d^2*cos(e + f*x) + 60*b^3*c*d*sin(2*e + 2*f*x) - (15*b^3*c*d*
sin(4*e + 4*f*x))/2 - 120*a^3*c^2*f*x - 60*a^3*d^2*f*x - 60*a*b^2*c*d*cos(3*e + 3*f*x) + 180*a^2*b*c*d*sin(2*e
 + 2*f*x) - 180*a*b^2*c^2*f*x - 135*a*b^2*d^2*f*x + 540*a*b^2*c*d*cos(e + f*x) - 90*b^3*c*d*f*x - 360*a^2*b*c*
d*f*x)/(120*f)